

import pickle   #python中才认识pickle

def say(name):
    print('hello',name)

info = {
    'name':'ouyang',
    'age':22,
    'func':say  #内存地址
}
f = open('a.txt', 'wb')
# data = pickle.loads((f.read()))
pickle.dump(info,f)   #f.write(pickle.dumps(info) )

f.close()
